package com.frame.common.model;


import com.frame.common.constant.ParametersConstants;
import com.frame.servlet.HttpServletUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * @author revelin
 * @date 下午4:53 18-2-6
 **/
@ApiModel("id")
@Slf4j
public class ReqUserId extends ReqLanguageInfo{


	@ApiModelProperty(value="userId",hidden = true)
    @Setter
    private Long userId;



    public Long getUserId(){
		Object userIdObj = HttpServletUtil.getHttpServletRequest().getAttribute(ParametersConstants.USER_ID);
		if(userIdObj!=null){
			log.error("用户id:"+userIdObj.toString());
			return Long.parseLong(userIdObj.toString());
		}else{
			return this.userId;
		}

	}

}
